package com.dexin.yang.base.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.dexin.yang.base.dao.IBaseDaoService;
import com.dexin.yang.base.service.IBaseService;
@Service
public class BaseServiceImpl<T extends Serializable,ID extends Serializable> implements IBaseService<T,ID>{
	
	@Autowired
	protected IBaseDaoService<T,ID> baseDao;
	
	@Override
	public List<T> createQuery(String queryString) {
		// TODO Auto-generated method stub
		return baseDao.createQuery(queryString);
	}

	@Override
	public ID save(T model) {
		return  baseDao.save(model);
	}

	@Override
	public <T> void update(T model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public <T> void delete(T model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public T get(T model) {
		T t = baseDao.get(model);
		return t;
	}

	@Override
	public List<T> getAll(Class<? extends T> model) {
		List<T> list = baseDao.getAll(model);
		return list;
	}

	@Override
	public List<T> getByPage(final String hql,final Object params, final Integer start,final Integer size) {
		return baseDao.getByPage(hql, params, start, size);
	}

	@Override
	public <T> T get(Class<? extends T> clazz, Long id) {
		// TODO Auto-generated method stub
		return baseDao.get(clazz, id);
	}


}
